<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap -->

<link href="<%=basePath %>resources/css/bootstrap.min.css" rel="stylesheet" media="screen">
<script src="<%=basePath %>resources/jslib/jquery.js"></script>
<script src="<%=basePath %>resources/jslib/bootstrap.min.js"></script>
<script  type="text/javascript">
//登录
	function onDelete(uid,userName) {
		//登录处
		  $("#myModaMsg").html("确认删除加工设备：("+userName+").......");
		 $('#myModal').modal({
		        keyboard: true
		    });
		 $("#comfigDelete").bind("click",function(){
			 $.ajax({
					type: "post",
					url : "<%=basePath %>system/deleteDevice.action",
					data :{"uid":uid},
					success : function(data){
		                       if(data.code=="0000"){
		                    	   $("#tr"+uid).remove();
		                       }else{
		                           $("#mes").html(data.code+"##"+data.message);
		                        }
		                      
		             },
					 dataType : "json"
				});
		 });
		
	}
</script>
</head>
<body>
<!-- 模态框（Modal） -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
					&times;
				</button>
				<h4 class="modal-title" id="myModalLabel">
					删除确认
				</h4>
			</div>
			<div class="modal-body" id="myModaMsg">
				在这里添加一些文本
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">取消
				</button>
				<button type="button" class="btn btn-primary" data-dismiss="modal" id="comfigDelete">
					确认删除
				</button>
			</div>
		</div><!-- /.modal-content -->
	</div><!-- /.modal -->
</div>

<ol class="breadcrumb">
	<li><a href="#">登陆</a></li>
	<li><a href="#">首页</a></li>
	<li class="active">加工设备列表</li>
</ol>
<table class="table table-hover table-bordered">
  <thead>
    <tr>
      <th>序号</th>
      <th>设备名称</th>
      <th>最后修改时间</th>
      <th>设备描述</th>
      <th>操作</th>
    </tr>
  </thead>
  <tbody>
   <c:forEach items="${datas}" var="item"  varStatus="status">
        <tr id="tr${item.id}" <c:if test="${status.index/2==0}">class="odd"</c:if>>
            <td>${status.index+1}</td>
			<td>${item.name}</td>
			<td>${item.descript}</td>
			<td>${item.lastUpdateTimeStr}</td>
			
			<td><a  href="<%=basePath %>system/deviceToUpdate.action?uid=${item.id}" class="img_edit hand" title="修改加工设备">修改|</a>
			<a  onclick="onDelete(${item.id},'${item.name}')" class="img_edit hand" title="删除数据">|删除</a></td>
		</tr>
       </c:forEach>
    
  </tbody>
</table>

<ul class="pagination">
    <li><a href="#">&laquo;</a></li>
    <li><a href="#" class="active" >1</a></li>
    <li><a href="#">2</a></li>
    <li><a href="#">3</a></li>
    <li><a href="#">4</a></li>
    <li><a href="#">5</a></li>
    <li><a href="#">&raquo;</a></li>
</ul>

</body>
</html>